const {app, BrowserWindow} = require('electron')
const path = require('path')

// Specify flash path, supposing it is placed in the same directory with main.js.
let pluginName = "shit"
switch (process.platform) {
    case 'win32':
        pluginName = 'pepflashplayer64_27_0_0_130.dll'
        break
    case 'darwin':
        pluginName = 'PepperFlashPlayer.plugin'
        break
    case 'linux':
        pluginName = 'libpepflashplayer.so'
        break
}
// console.log(pluginName)
// let flashPath = "C:\\Windows\\System32\\Macromed\\Flash"
app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, pluginName))

// Optional: Specify flash version, for example, v17.0.0.169
app.commandLine.appendSwitch('ppapi-flash-version', '27.0.0.130')

app.on('ready', () => {
    let win = new BrowserWindow({
        width: 800,
        height: 600,
        webPreferences: {
            plugins: true
        }
    })
    win.loadURL(`file://F:\\study\\html\\workspace\\TaoUIDesigner\\FlexModule\\bin\\Main.html`)
// Something else
})